package models
import (
	//"gintest/database"
	//"time"
)
//商品属性中间表
type GoodsAttr struct{
	GoodsId int `json:"goods_id" gorm:"column:goods_id" form:"goods_id"`
	AttributeId int `json:"attribute_id" gorm:"column:attribute_id" form:"attribute_id"`
	GoodsAttribute GoodsAttribute `json:"goods_attribute" gorm:"ForeignKey:AttributeId;AssociationForeignKey:Id"`
}
func (GoodsAttr) TableName() string {
	return "goods_attr"
}
//属性值表
type GoodsAttributeValue struct{
	Id int `json:"id" gorm:"column:id;primary_key" form:"id"`
	AttributeId int `json:"attribute_id" gorm:"column:attribute_id" form:"attribute_id"`
	Title string `json:"title" gorm:"column:title" form:"title"`
}
func (GoodsAttributeValue) TableName() string {
	return "goods_attribute_value"
}
//属性表
type GoodsAttribute struct{
	Id int `json:"id" gorm:"column:id;primary_key" form:"id"`
	Title string `json:"title" gorm:"column:title" form:"title"`
	GoodsAttributeValue  []GoodsAttributeValue `json:"goods_attribute_value" gorm:"ForeignKey:AttributeId;AssociationForeignKey:Id"`
}
func (GoodsAttribute) TableName() string {
	return "goods_attribute"
}
